home *** CD-ROM | disk | FTP | other *** search
/ Merciful 1 / Merciful - Disc 1.iso / software / a / asm_one / asm-onev1.25a.dms / in.adf / Release3.1 / AutoDocs3.1.lha / doc / printer.doc < prev    next >
Encoding:
Text File  |  1993-08-12  |  42.4 KB  |  1,096 lines

  1. TABLE OF CONTENTS
  2.  
  3. printer.device/CMD_FLUSH
  4. printer.device/CMD_INVALID
  5. printer.device/CMD_RESET
  6. printer.device/CMD_START
  7. printer.device/CMD_STOP
  8. printer.device/CMD_WRITE
  9. printer.device/PRD_DUMPRPORT
  10. printer.device/PRD_PRTCOMMAND
  11. printer.device/PRD_QUERY
  12. printer.device/PRD_RAWWRITE
  13. printer.device/PWrite
  14. printer.device/CMD_FLUSH                             printer.device/CMD_FLUSH
  15.  
  16.    NAME
  17.     CMD_FLUSH -- abort all I/O requests (immediate)
  18.  
  19.    FUNCTION
  20.     CMD_FLUSH aborts all stopped I/O at the unit.
  21.  
  22.    IO REQUEST
  23.     io_Message    mn_ReplyPort set if quick I/O is not possible
  24.     io_Device    preset by the call to OpenDevice
  25.     io_Command    CMD_FLUSH
  26.     io_Flags    IOB_QUICK set if quick I/O is possible
  27.  
  28. printer.device/CMD_INVALID                         printer.device/CMD_INVALID
  29.  
  30.    NAME
  31.     CMD_INVALID -- invalid command
  32.  
  33.    FUNCTION
  34.     CMD_INVALID is always an invalid command, and sets the device
  35.     error appropriately.
  36.  
  37.    IO REQUEST
  38.     io_Message    mn_ReplyPort set if quick I/O is not possible
  39.     io_Command    CMD_INVALID
  40.     io_Flags    IOB_QUICK set if quick I/O is possible
  41.  
  42. printer.device/CMD_RESET                             printer.device/CMD_RESET
  43.  
  44.    NAME
  45.     CMD_RESET -- reset the printer
  46.  
  47.    FUNCTION
  48.     CMD_RESET resets the printer device without destroying handles
  49.     to the open device.
  50.  
  51.    IO REQUEST
  52.     io_Message    mn_ReplyPort set if quick I/O is not possible
  53.     io_Device    preset by the call to OpenDevice
  54.     io_Command    CMD_RESET
  55.     io_Flags    IOB_QUICK set if quick I/O is possible
  56.  
  57. printer.device/CMD_START                             printer.device/CMD_START
  58.  
  59.    NAME
  60.     CMD_START -- restart after stop (immediate)
  61.  
  62.    FUNCTION
  63.     CMD_START restarts the unit after a stop command.
  64.  
  65.    IO REQUEST
  66.     io_Message    mn_ReplyPort set if quick I/O is not possible
  67.     io_Device    preset by the call to OpenDevice
  68.     io_Command    CMD_START
  69.     io_Flags    IOB_QUICK set if quick I/O is possible
  70.  
  71. printer.device/CMD_STOP                               printer.device/CMD_STOP
  72.  
  73.    NAME
  74.     CMD_STOP -- pause current and queued I/O requests (immediate)
  75.  
  76.    FUNCTION
  77.     CMD_STOP pauses all queued requests for the unit, and tries to
  78.     pause the current I/O request.  The only commands that will
  79.     be subsequently allowed to be performed are immediate I/O
  80.     requests, which include those to start, flush, and finish the
  81.     I/O after the stop command.
  82.  
  83.    IO REQUEST
  84.     io_Message    mn_ReplyPort set if quick I/O is not possible
  85.     io_Device    preset by the call to OpenDevice
  86.     io_Command    CMD_STOP
  87.     io_Flags    IOB_QUICK set if quick I/O is possible
  88.  
  89. printer.device/CMD_WRITE                             printer.device/CMD_WRITE
  90.  
  91.    NAME
  92.       CMD_WRITE -- send output to the printer
  93.  
  94.    FUNCTION
  95.       This function causes a buffer of characters to be written to the
  96.       current printer port (usually parallel or serial).  The number of
  97.       characters is specified in io_Length, unless -1 is used, in which
  98.       case output is sent until a 0x00 is encountered.
  99.  
  100.       The Printer device, like the Console device, maps ANSI X3.64 style
  101.       7-bit printer control codes to the control code set of the current
  102.       printer.  The ANSI codes supported can be found below.
  103.  
  104.    NOTES
  105.       Not all printers will support all functions.  In particular you may
  106.       not assume that the MARGINS or TABS can be set.  Close to half the
  107.       supported printers don't fully implement one or the other.  If you
  108.       want the features of margins or tabs you will need to fake it
  109.       internally by sending out spaces.
  110.  
  111.       Note that the printer device may have already sent out a "set
  112.       margins" command to the printer.  If you are faking your own
  113.       margins, be sure to cancel the old ones first.  (use the "aCAM"
  114.       command)
  115.  
  116.       Defaults are set up so that if a normal AmigaDOS text file
  117.       is sent to PRT:, it has the greatest chance of working.
  118.       (AmigaDOS text files are defined as follows:)
  119.               tabs            - every 8
  120.               CR (0x0D)       - moves to start of current line
  121.               LF (0x0A)       - moves to start of next line
  122.  
  123.    IO REQUEST
  124.        io_Message      mn_ReplyPort set
  125.        io_Device       preset by OpenDevice
  126.        io_Unit         preset by OpenDevice
  127.        io_Command      CMD_WRITE
  128.        io_Length       number of characters to process, or if -1,
  129.                        process until 0x00 encountered
  130.        io_Data         pointer to block of data to process
  131.  
  132.    RESULTS
  133.        io_Error : if CMD_WRITE succeeded, then io_Error will be zero.
  134.               Otherwise io_Error will be non-zero.
  135.  
  136.    SEE ALSO
  137.        printer.h, parallel.device, serial.device, Preferences
  138.  
  139.  
  140.    ANSI X3.64 style COMMANDS
  141.  
  142.  aRIS         ESCc            hard reset
  143.  aRIN         ESC#1           initialize to defaults
  144.  aIND         ESCD            true linefeed (lf)
  145.  aNEL         ESCE            return,lf
  146.  aRI          ESCM            reverse lf              *
  147.  
  148.  aSGR0        ESC[0m          normal character set
  149.  aSGR3        ESC[3m          italics on
  150.  aSGR23       ESC[23m         italics off
  151.  aSGR4        ESC[4m          underline on
  152.  aSGR24       ESC[24m         underline off
  153.  aSGR1        ESC[1m          boldface on
  154.  aSGR22       ESC[22m         boldface off
  155.  aSFC         SGR30-39        set foreground color
  156.  aSBC         SGR40-49        set background color
  157.  
  158.  aSHORP0      ESC[0w          normal pitch
  159.  aSHORP2      ESC[2w          elite on
  160.  aSHORP1      ESC[1w          elite off
  161.  aSHORP4      ESC[4w          condensed on
  162.  aSHORP3      ESC[3w          condensed off
  163.  aSHORP6      ESC[6w          enlarged on
  164.  aSHORP5      ESC[5w          enlarged off
  165.  
  166.  aDEN6        ESC[6"z         shadow print on
  167.  aDEN5        ESC[5"z         shadow print off
  168.  aDEN4        ESC[4"z         doublestrike on
  169.  aDEN3        ESC[3"z         doublestrike off
  170.  aDEN2        ESC[2"z         Near Letter Quality (NLQ) on
  171.  aDEN1        ESC[1"z         NLQ off
  172.  
  173.  aSUS2        ESC[2v          superscript on
  174.  aSUS1        ESC[1v          superscript off
  175.  aSUS4        ESC[4v          subscript on
  176.  aSUS3        ESC[3v          subscript off
  177.  aSUS0        ESC[0v          normalize the line      *
  178.  aPLU         ESCL            partial line up         *
  179.  aPLD         ESCK            partial line down       *
  180.  
  181.  aFNT0        ESC(B           US char set (default)   or Font 0
  182.  aFNT1        ESC(R           French char set         or Font 1
  183.  aFNT2        ESC(K           German char set         or Font 2
  184.  aFNT3        ESC(A           UK char set             or Font 3
  185.  aFNT4        ESC(E           Danish I char set       or Font 4
  186.  aFNT5        ESC(H           Sweden char set         or Font 5
  187.  aFNT6        ESC(Y           Italian char set        or Font 6
  188.  aFNT7        ESC(Z           Spanish char set        or Font 7
  189.  aFNT8        ESC(J           Japanese char set       or Font 8
  190.  aFNT9        ESC(6           Norweign char set       or Font 9
  191.  aFNT10       ESC(C           Danish II char set      or Font 10
  192.  
  193.  aPROP2       ESC[2p          proportional on         *
  194.  aPROP1       ESC[1p          proportional off        *
  195.  aPROP0       ESC[0p          proportional clear      *
  196.  aTSS         ESC[n E         set proportional offset *
  197.  aJFY5        ESC[5 F         auto left justify       *
  198.  aJFY7        ESC[7 F         auto right justify      *
  199.  aJFY6        ESC[6 F         auto full justify       *
  200.  aJFY0        ESC[0 F         auto justify off        *
  201.  aJFY3        ESC[3 F         letter space (justify)  *
  202.  aJFY1        ESC[1 F         word fill(auto center)  *
  203.  
  204.  aVERP0       ESC[0z          1/8" line spacing
  205.  aVERP1       ESC[1z          1/6" line spacing
  206.  aSLPP        ESC[nt          set form length n
  207.  aPERF        ESC[nq          set perforation skip to n lines (n>0)
  208.  aPERF0       ESC[0q          perforation skip off
  209.  
  210.  aLMS         ESC#9           Left margin set         *
  211.  aRMS         ESC#0           Right margin set        *
  212.  aTMS         ESC#8           Top margin set          *
  213.  aBMS         ESC#2           Bottom margin set       *
  214.  aSTBM        ESC[Pn1;Pn2r    set T&B margins         *
  215.  aSLRM        ESC[Pn1;Pn2s    set L&R margin          *
  216.  aCAM         ESC#3           Clear margins
  217.  
  218.  aHTS         ESCH            Set horiz tab           *
  219.  aVTS         ESCJ            Set vertical tabs       *
  220.  aTBC0        ESC[0g          Clr horiz tab           *
  221.  aTBC3        ESC[3g          Clear all h tab         *
  222.  aTBC1        ESC[1g          Clr vertical tabs       *
  223.  aTBC4        ESC[4g          Clr all v tabs          *
  224.  aTBCALL      ESC#4           Clr all h & v tabs      *
  225.  aTBSALL      ESC#5           Set default tabs (every 8)
  226.  
  227.  aEXTEND      ESC[Pn"x        Extended commands
  228.                               This is a mechanism for printer drivers to
  229.                               support extra commands which can be called
  230.                               by ANSI control sequences
  231.  aRAW         ESC[Pn"r        Next 'Pn' chars are raw (ie. they are not
  232.                               parsed by the printer device, instead they
  233.                               are sent directly to the printer.
  234.  
  235.  
  236.  (*) indicates that sending this command may cause unexpected results
  237.      on a large number of printers.
  238.  
  239. printer.device/PRD_DUMPRPORT                     printer.device/PRD_DUMPRPORT
  240.  
  241.    NAME
  242.     PRD_DUMPRPORT -- dump the specified RastPort to a graphics printer
  243.  
  244.    FUNCTION
  245.     Print a rendition of the supplied RastPort, using the supplied
  246.     ColorMap, position and scaling information, as specified in
  247.     the printer preferences.
  248.  
  249.    IO REQUEST
  250.     io_Message    mn_ReplyPort set if quick I/O is not possible.
  251.     io_Command    PRD_DUMPRPORT.
  252.     io_Flags    IOB_QUICK set if quick I/O is possible.
  253.     io_RastPort    ptr to a RastPort.
  254.     io_ColorMap    ptr to a ColorMap.
  255.     io_Modes    the 'modes' flag from a ViewPort structure,
  256.             (the upper word is reserved and should be zero).
  257.  
  258.             If you are running under version 36, or greater
  259.             of graphics.library, it is recommended that
  260.             you fill in "io_Modes" with the ULONG (32-bit)
  261.             value returned from calling:
  262.  
  263.             ULONG ModeID = GetVPModeID(struct ViewPort *);
  264.  
  265.             Doing so provides for upwards compatability with
  266.             the new display modes available under V36
  267.             (example: aspect ratio calculations for new
  268.             display modes).
  269.  
  270.     io_SrcX        x offset into the RastPort to start printing from.
  271.     io_SrcY        y offset into the RastPort to start printing from.
  272.     io_SrcWidth    width of the RastPort to print (from io_SrcX).
  273.     io_SrcHeight    height of the RastPort to print (from io_SrcY).
  274.     io_DestCols    width of the printout in printer pixels.
  275.     io_DestRows    height of the printout in printer pixels.
  276.     io_Special    flag bits
  277.             (some of which pertain to DestCols and DestRows).
  278.             -if SPECIAL_MIL is set, then the associated
  279.              parameter is specified in thousandths of
  280.              an inch on the printer.  ie. if DestCols = 8000,
  281.              DestRows = 10500 and SPECIAL_MILROWS and
  282.              SPECIAL_MILCOLS is set then the printout would be
  283.              8.000 x 10.500 inches.
  284.             -if SPECIAL_FULL is set, then the specific dimension
  285.              is set to the maximum possible as determined
  286.              by the printer limits or the configuration
  287.              limits; whichever is less.
  288.             -if SPECIAL_FRAC is set, the parameter is
  289.              taken to be a longword binary fraction
  290.              of the maximum for that dimension.
  291.             -if all bits for a dimension are clear,
  292.              (ie. SPECIAL MIL/FULL/FRAC and ASPECT are NOT set)
  293.              then the parameter is specified in printer pixels.
  294.             -if SPECIAL_CENTER is set then the image will be
  295.              put between the left and right edge of the paper.
  296.             -if SPECIAL_ASPECT is set, one of the dimensions
  297.              may be reduced/expanded to preserve the aspect
  298.              ratio of the print.
  299.             -SPECIAL_DENSITY(1-7) this allows for a maximum of 7
  300.              different print densities.  DENSITY1 is the lowest
  301.              density and the default.
  302.             -SPECIAL_NOFORMFEED - this allows for the mixing of
  303.              text and graphics or multiple graphic dumps on page
  304.              oriented printers (usually laser jet printers).
  305.              When this flag is set the page will not be ejected
  306.              after a graphic dump.  If you perform another
  307.              graphic dump without this flag set OR close the
  308.              printer after printing text after a graphic dump,
  309.              the page will be ejected.
  310.             -if SPECIAL_TRUSTME is set then the printer specific
  311.              driver is instructed to not issue a reset command
  312.              before and after the dump.  If this flag is NOT
  313.              checked by the printer specific driver then setting
  314.              this flag has no effect.  Since we now recommend
  315.              that printer driver writers no longer issue a reset
  316.              command it is probably a safe idea to always set
  317.              this flag when calling for a dump.
  318.             -if SPECIAL_NOPRINT is set then the following is done:
  319.              Compute print size, set 'io_DestCols' and
  320.              'io_DestRows' in the calling program's 'IODRPReq'
  321.              structure and exit, DON'T PRINT.  This allows the
  322.              calling program to see what the final print size
  323.              would be in printer pixels.  Note that it modifies
  324.              the 'io_DestCols' and 'io_DestRows' fields of your
  325.              'IODRPReq' structure.  It also sets the print
  326.              density and updates the 'MaxXDots', 'MaxYDots',
  327.              'XDotsInch', and 'YDotsInch' fields of the
  328.              'PrinterExtendedData' structure.
  329.  
  330.     There following rules for the interpretation of io_DestRows and
  331.     io_DestCols that may produce unexpected results when they are
  332.     not greater than zero and io_Special is zero.  They have been
  333.     retained for compatability.  The user will not trigger these
  334.     other rules with well formed usage of io_Special.
  335.  
  336.     When io_Special is equal to 0, the following rules
  337.     (from the V1.1 printer.device, and retained for compatibility
  338.     reasons) take effect.  Remember, these special rules are
  339.     for io_DestRows and io_DestCols and only take effect
  340.     if io_Special is 0).
  341.  
  342.     a) DestCols>0 & DestRows>0 - use as absolute values.
  343.        ie. DestCols=320 & DestRows=200 means that the picture
  344.        will appear on the printer as 320x200 dots.
  345.     b) DestCols=0 & DestRows>0 - use the printers maximum number
  346.        of columns and print DestRows lines. ie. if DestCols=0
  347.        and DestRows=200 than the picture will appear on the
  348.        printer as wide as it can be and 200 dots high.
  349.     c) DestCols=0 & DestRows=0 - same as above except the driver
  350.        determines the proper number of lines to print based on
  351.        the aspect ratio of the printer. ie. This results in the
  352.        largest picture possible that is not distorted or inverted.
  353.        Note: As of this writing, this is the call made by such
  354.        program as DeluxePaint, GraphicCraft, and AegisImages.
  355.     d) DestCols>0 &DestRows=0 - use the specified width and the
  356.        driver determines the proper number of lines to print based
  357.        on the aspect ratio of the printer. ie. if you desire a
  358.        picture that is 500 pixels wide and aspect ratio correct,
  359.        use DestCols=500 and DestRows=0.
  360.     e) DestCols<0 or DestRows>0 - the final picture is either a
  361.        reduction or expansion based on the fraction
  362.        |DestCols| / DestRows in the proper aspect ratio.
  363.        Some examples:
  364.        1) if DestCols=-2 & DestRows=1 then the printed picture will
  365.           be 2x the AMIGA picture and in the proper aspect ratio.
  366.           (2x is derived from |-2| / 1 which gives 2.0)
  367.        2) if DestCols=-1 & DestRows=2 then the printed picture will
  368.           will be 1/2x the AMIGA picture in the proper aspect ratio.
  369.           (1/2x is derived from |-1| / 2 which gives 0.5)
  370.  
  371.    NOTES
  372.     The printer selected in preferences must have graphics
  373.     capability to use this command.  The error 'PDERR_NOTGRAPHICS'
  374.      is returned if the printer can not print graphics.
  375.  
  376.     Color printers may not be able to print black and white or
  377.     greyscale pictures -- specifically, the Okimate 20 cannot print
  378.     these with a color ribbon: you must use a black ribbon instead.
  379.     If the printer has an input buffer option, use it.
  380.     If the printer can be uni or bi directional, select
  381.     uni-directional; this produces a much cleaner picture.
  382.     Most printer drivers will attempt to set unidirectional
  383.     printing if it is possible under software control.
  384.  
  385.     Please note that the width and height of the printable area on
  386.     the printer is in terms of pixels and bounded by the following:
  387.      a) WIDTH = (RIGHT_MARGIN - LEFT_MARGIN + 1) / CHARACTERS_PER_INCH
  388.      b) HEIGHT = LENGTH / LINES_PER_INCH
  389.        Margins are set by preferences.
  390.  
  391.     For BGR printer support, the YMC values in the printer
  392.     specific render.c functions equate to BGR respectively, ie.
  393.     yellow is blue, magenta is green, and cyan is red.
  394.  
  395.     For version 2.1 of the Operating System (the Localization
  396.     release), some of the printer drivers have been modified to
  397.     support European A size paper (e.g., "A4").  See preferences.h
  398.     for a list of defined sizes.  For most printers, this means
  399.     the maximum X dots will be calculated based on millimeters
  400.     minus 1/2 inch (approx 13 mm) - this is consistent with existing
  401.     driver calculations (e.g., 8.0 inches wide for US_LETTER, and
  402.     US_LEGAL sizes).
  403.  
  404.     Some printers, like the HP_LaserJet, and HP_DeskJet also
  405.     calculate maximum Y dots.
  406.  
  407.     For all modified printer drivers, selecting paper sizes larger
  408.     than the printer can handle may result in unexpected, or
  409.     clipped results.  This allows for the possibility of using
  410.     these drivers with future printers which may physically
  411.     [and internally] support these larger sizes of paper.
  412.  
  413.     It is assumed that the user will make reasonable choices when
  414.     selecting paper size (e.g., not select WIDE TRACTOR for a
  415.     NARROW TRACTOR printer).
  416.  
  417.  Data Structures
  418.  ---------------
  419.  
  420.     The printer specific and non-specific data structures can be read
  421.     ONCE you have opened the printer device.  Here is a code fragment
  422.     to illustrate how to do just that.
  423.  
  424.     #include <exec/types.h>
  425.     #include <devices/printer.h>
  426.     #include <devices/prtbase.h>
  427.     #include <devices/prtgfx.h>
  428.  
  429.     struct IODRPReq PReq;
  430.     struct PrinterData *PD;
  431.     struct PrinterExtendedData *PED;
  432.  
  433.    open the printer device / if it opened...
  434.    if (OpenDevice("printer.device", 0, &PReq, 0) == NULL) {
  435.        get pointer to printer data
  436.        PD = (struct PrinterData *)PReq.io_Device;
  437.        get pointer to printer extended data
  438.        PED = &PD->pd_SegmentData->ps_PED;
  439.        let's see what's there
  440.        printf("PrinterName = '%s', Version=%u, Revision=%u\n",
  441.            PED->ped_PrinterName, PD->pd_SegmentData->ps_Version,
  442.            PD->pd_SegmentData->ps_Revision,);
  443.        printf("PrinterClass=%u, ColorClass=%u\n",
  444.            PED->ped_PrinterClass, PED->ped_ColorClass);
  445.        printf("MaxColumns=%u, NumCharSets=%u, NumRows=%u\n",
  446.            PED->ped_MaxColumns, PED->ped_NumCharSets, PED->ped_NumRows);
  447.        printf("MaxXDots=%lu, MaxYDots=%lu, XDotsInch=%u, YDotsInch=%u\n",
  448.            PED->ped_MaxXDots, PED->ped_MaxYDots,
  449.            PED->ped_XDotsInch, PED->ped_YDotsInch);
  450.        CloseDevice(&PReq);
  451.    }
  452.  
  453.  Preferences
  454.  -----------
  455.  
  456.     If you want the user to be able to access the printer preferences items
  457.  without having to run preferences (like DPAINT II's printer requester),
  458.  here is what you do.  You can look at the printer's copy of preferences
  459.  by referring to 'PD->pd_Preferences' (the printer device MUST already be
  460.  opened at this point).  After you have this you could put up a requester
  461.  and allow the user to change whatever parameters they wanted.
  462.  BEAR IN MIND THAT YOU ARE RESPONSIBLE FOR RANGE CHECKING THESE SELECTIONS!
  463.  Listed below are the printer preferences items and their valid values.
  464.  
  465.  PrintPitch         - PICA, ELITE, FINE.
  466.  PrintQuality       - DRAFT, LETTER.
  467.  PrintSpacing       - SIX_LPI, EIGHT_LPI.
  468.  PrintLeftMargin    - 1 to PrintRightMargin.
  469.  PrintRightMargin   - PrintLeftMargin to 999.
  470.  PaperLength        - 1 to 999.
  471.  PrintImage         - IMAGE_POSITIVE, IMAGE_NEGATIVE.
  472.  PrintAspect        - ASPECT_HORIZ, ASPECT_VERT.
  473.  PrintShade         - SHADE_BW, SHADE_GREYSCALE, SHADE_COLOR.
  474.  PrintThreshold     - 1 to 15.
  475.  PrintFlags         - CORRECT_RED, CORRECT_GREEN, CORRECT_BLUE, CENTER_IMAGE,
  476.                       IGNORE_DIMENSIONS, BOUNDED_DIMENSIONS,
  477.                       ABSOLUTE_DIMENSIONS, PIXEL_DIMENSIONS,
  478.                       MULTIPLY_DIMENSIONS, INTEGER_SCALING,
  479.                       ORDERED_DITHERING, HALFTONE_DITHERING.
  480.                       FLOYD_DITHERING, ANTI_ALIAS, GREY_SCALE2
  481.  PrintMaxWidth      - 0 to 65535.
  482.  PrintMaxHeight     - 0 to 65535.
  483.  PrintDensity       - 1 to 7.
  484.  PrintXOffset       - 0 to 255.
  485.  
  486.  Asynchronous I/O
  487.  ----------------
  488.  
  489.      The recommended way to do asynchronous i/o is...
  490.  
  491.  a) To send requests for i/o.
  492.  
  493.      struct IORequest *ioreq;
  494.      struct MsgPort *port;
  495.      UBYTE signal;
  496.  
  497.      port = ioreq->io_Message.mn_ReplyPort;
  498.      signal = port->mp_SigBit;
  499.  
  500.      SendIO(ioreq);  send request
  501.      Wait(signal);  wait for completion (go to sleep)
  502.      while ((Msg = GetMsg(port)) != NULL) {  get ALL messages
  503.      }
  504.  
  505.  b) To abort a previous request for i/o.
  506.  
  507.      struct IORequest *ioreq;
  508.  
  509.      AbortIO(ioreq);  abort request
  510.      WaitIO(ioreq);  wait for reply
  511.  
  512.      at this point you can re-use 'ioreq'.
  513.  
  514.      Note that in the above examples 'ioreq' could be any one of...
  515.      a) struct IOStdReq    a standard i/o request
  516.      b) struct IODRPReq    a dumprport i/o request
  517.      c) struct IOPrtCmdReq a printer command i/o request
  518.  
  519.      It is recommend that you do asynchronous i/o in your programs
  520.      and give the user a way of aborting all requests.
  521.  
  522.  
  523.          V1.3 Printer Driver Notes
  524.          -------------------------
  525.  
  526.      In general densities which use more than one pass should only be
  527.  used for B&W shade dumps.  They can be used for Grey-Scale or Color Shade
  528.  dumps BUT the output may tend to look muddy or dark.  Also multiple pass
  529.  Color dumps tend to dirty or smear the ribbon (ie. yellow will get
  530.  contaminated with the other colors on the ribbon; you have been warned).
  531.  
  532.  
  533.  Alphacom_AlphaPro_101
  534.  ---------------------
  535.  1. Daisywheel printer (text only).
  536.  
  537.  Brother_HR-15XL
  538.  ---------------
  539.  1. Daisywheel printer (text only).
  540.  
  541.  CalComp_ColorMaster
  542.  -------------------
  543.  1. Thermal transfer b&w/color printer (text and graphics).
  544.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  545.  3. Linefeeds # of vertical dots printed.
  546.  4. Densities supported are 203x200(1) dpi.
  547.  5. This is a dual printer driver.  Select a PaperSize of 'Narrow Tractor'
  548.     for use with the ColorMaster; 'Wide Tractor' for use with the
  549.     ColorView-5912 (which uses 11 x 17 inch paper).
  550.  
  551.  CalComp_ColorMaster2
  552.  -------------------
  553.  1. Thermal transfer b&w/color printer (text and graphics).
  554.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  555.  3. Linefeeds # of vertical dots printed.
  556.  4. Densities supported are 203x200(1) dpi.
  557.  5. This is a dual printer driver.  Select a PaperSize of 'Narrow Tractor'
  558.     for use with the ColorMaster; 'Wide Tractor' for use with the
  559.     ColorView-5912 (which uses 11 x 17 inch paper).
  560.  6. This driver is the same as the Calcomp_ColorMaster driver EXCEPT it is
  561.     approximately 2 times faster (during color dumps) and requires LOTS of
  562.     memory (up to 1,272,003 bytes for a full 8 x 10 inch (1600 x 2000 dot)
  563.     color dump).  Typically full-size (color) dumps are 1600 x 1149 dots and
  564.     require 730,767 bytes.  Memory requirements for the ColorView-5912
  565.     are up to 2,572,803 bytes for a full 10 x 16 inch (2048 x 3200 dot)
  566.     color dump.  Typically full-size (color) dumps are 2048 x 2155 dots and
  567.     require 1,732,623 bytes.  The memory requirements are 1/3 when doing a
  568.     non-color printout (on both the ColorMaster and ColorView).
  569.  
  570.  Canon_PJ-1080A
  571.  --------------
  572.  1. Ink jet b&w/color printer (text and graphics).
  573.  2. Linefeeds # of vertical dots printed.
  574.  3. Densities supported are 83x84(1) dpi.
  575.  
  576.  CBM_MPS1000
  577.  -----------
  578.  1. Dot matrix b&w printer (text and graphics).
  579.  2. Linefeeds # of vertical dots printed (-1/3 dot if PaperType = Single). *2
  580.  3. Density    XDPI    YDPI    XYDPI    Comments
  581.      1    120     72     8640
  582.      2    120    144    17280    two pass
  583.      3    240     72    17280            *1
  584.      4    120    216    25920    three pass
  585.      5    240    144    34560    two pass    *1
  586.      6    240    216    51840    three pass    *1
  587.      7    same as 6
  588.  4. Print width for US_LETTER size paper is 8.0 inches.
  589.  5. As of version 35.48, this driver calculates maximum X dots for
  590.     European A size paper as defined in preferences.h.  Some of
  591.     these sizes are too large for this printer.
  592.  
  593.  Diablo_630
  594.  ----------
  595.  1. Daisywheel printer (text only).
  596.  
  597.  Diablo_Advantage_D25
  598.  --------------------
  599.  1. Daisywheel printer (text only).
  600.  
  601.  Diablo_C-150
  602.  ------------
  603.  1. Ink jet b&w/color printer (text and graphics).
  604.  2. Always linefeeds 4 dots (limitation of printer).
  605.  3. A PaperSize of 'Wide Tractor' selects a maximum print width of
  606.     8.5 inches (for wide roll paper).
  607.  5. Densities supported are 120x120(1) dpi.
  608.  
  609.  EpsonQ (24-pin Epson compatible)
  610.  ------
  611.  1. Dot matrix b&w/color printer (text and graphics).
  612.  2. Drives all EpsonQ (LQ1500, LQ2500, etc.) compatible printers.
  613.  3. Linefeeds # of vertical dots printed.
  614.  4. Density    XDPI    YDPI    XYDPI    Comments
  615.      1     90    180    16200
  616.      2    120    180    21600
  617.      3    180    180    32400
  618.      4    360    180    64800    *1
  619.      5,6,7    same as 4
  620.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  621.     13.6 inches (for wide carriage printers).
  622.  6. A PaperType of 'Single' uses only 16 of the 24 pins, whereas a PaperType
  623.     of 'Fanfold' uses all 24 pins.  The 'Single' option is useful for those
  624.     printers which have a weak power supply and cannot drive all 24 pins
  625.     continuously.  If during a single pass of the print head you notice that
  626.     the top two thirds of the graphics are darker than the bottom one third
  627.     then you will probably need to drop down to 16 pins.
  628.  7. As of version 35.71, this driver calculates maximum X dots for
  629.     European A size paper as defined in preferences.h.  The calculation
  630.     is based on millimeters minus 1/2 inch (approx 13mm).  Maximum
  631.     paper width is 13.6 inches, so some European A sizes are too large
  632.     for this printer.
  633.  
  634.  EpsonX[CBM_MPS-1250] (8/9-pin Epson compatible)
  635.  --------------------
  636.  1. Dot matrix b&w/color printer (text and graphics).
  637.  2. Drives all EpsonX (EX/FX/JX/LX/MX/RX, etc.) compatible printers.
  638.  3. Linefeeds # of vertical dots printed (-1/3 dot if PaperType = Single). *2
  639.  4. Density    XDPI    YDPI    XYDPI    Comments
  640.      1    120     72     8640
  641.      2    120    144    17280    two pass
  642.      3    240     72    17280            *1
  643.      4    120    216    25920    three pass
  644.      5    240    144    34560    two pass    *1
  645.      6    240    216    51840    three pass    *1
  646.      7    same as 6
  647.  
  648.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  649.     13.6 inches (for wide carriage printers).
  650.  6. Use this driver if you own a CBM_MPS-1250 (as it is EpsonX compatible).
  651.  7. As of version 35.42, this driver calculates maximum X dots for
  652.     European A size paper as defined in preferences.h.  The calculation
  653.     is based on millimeters minus 1/2 inch (approx 13mm).  Maximum
  654.     paper width is 13.6 inches, so some European A sizes are too large
  655.     for this printer.
  656.  
  657.  EpsonXOld (8/9-pin Epson compatible)
  658.  ---------
  659.  1. Dot matrix b&w printer (text and graphics).
  660.  2. Drives all very old EpsonX (EX/FX/JX/LX/MX/RX, etc.) compatible printers.
  661.  3. Linefeeds # of vertical dots printed.
  662.  4. Density    XDPI    YDPI    XYDPI    Comments
  663.      1     60    72     4320
  664.      2    120    72     8640    (double speed)            *1
  665.      3    120    72     8640
  666.      4    240    72    17280                    *1
  667.      5    120    72     8640    (for use on old Star printers)
  668.      6    240    72    17280    (for use on old Star printers)    *1
  669.      7    240    72    17280    (same as density 4)        *1
  670.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  671.     13.6 inches (for wide carriage printers).
  672.  6. Use this driver if the EpsonX driver does not work properly in graphics
  673.     or text mode on your EpsonX compatible printer.
  674.  
  675.  generic
  676.  -------
  677.  1. Text only printer.
  678.  
  679.  Howtek_Pixelmaster
  680.  ------------------
  681.  1. Plastic ink jet b&w/color printer (text and graphics).
  682.  2. Linefeeds # of vertical dots printed.
  683.  3. Density    XDPI    YDPI    XYDPI    Comments
  684.      1     80     80     6400
  685.      2    120    120    14400
  686.      3    160    160    25600
  687.      4    240    240    57600
  688.      5,6,7    same as 4
  689.  4. Maximum print area is 8.0 x 10.0 inches.
  690.  
  691.  HP_DeskJet
  692.  ----------
  693.  1. Ink jet non-color printer (text and graphics).
  694.  2. Linefeeds # of vertical dots printed.
  695.  3. Density    XDPI    YDPI    XYDPI    Comments
  696.      1     75     75     5625
  697.      2    100    100    10000
  698.      3    150    150    22500
  699.      4    300    300    90000
  700.      5,6,7    same as 4
  701.  4. Maximum print area is 8.0 x 10.0 inches US_LEGAL, and 8.0 x
  702.     13.0 inches US_LETTER.
  703.  5. As of version 35.29, the driver will calculate maximum area
  704.     size for European A size paper as defined in preferences.h.
  705.     The driver calculates the maximum X, and Y dots based on
  706.     millimeters, minus 1/2 inch from the width, and minus 1"
  707.     from the height (approx 13mm, and 26mm respectively).
  708.     Therefore the margin area is consistent with US paper sizes.
  709.  6. Some European A sizes are too large for this printer.
  710.  
  711.  HP_LaserJet (LaserJet+/LaserJetII compatible)
  712.  -----------
  713.  1. Laser engine non-color printer (text and graphics).
  714.  2. Linefeeds # of vertical dots printed.
  715.  3. Density    XDPI    YDPI    XYDPI    Comments
  716.      1     75     75     5625
  717.      2    100    100    10000
  718.      3    150    150    22500
  719.      4    300    300    90000
  720.      5,6,7    same as 4
  721.  4. Maximum print area is 8.0 x 10.0 inches US_LEGAL, and 8.0 x
  722.     13.0 inches US_LETTER.
  723.  5. As of version 35.59, the driver will calculate maximum area
  724.     size for European A size paper as defined in preferences.h.
  725.     The driver calculates the maximum X, and Y dots based on
  726.     millimeters, minus 1/2 inch from the width, and minus 1"
  727.     from the height (approx 13 mm, and 26 mm respectively).
  728.     Therefore the margin area is consistent with US paper sizes.
  729.  6. Some European A sizes are too large for this printer.
  730.  
  731.  HP_PaintJet
  732.  -----------
  733.  1. Ink jet b&w/color printer (text and graphics).
  734.  2. Linefeeds # of vertical dots printed.
  735.  3. Densities supported are 180x180(1) dpi.
  736.  
  737.  HP_ThinkJet
  738.  ----------
  739.  1. Ink jet non-color printer (text and graphics).
  740.  2. Linefeeds # of vertical dots printed.
  741.  3. Density    XDPI    YDPI    XYDPI    Comments
  742.      1     96    96     9216
  743.      2    192    96    18432
  744.      3,4,5,6,7    same as 4
  745.  4. This printer prints 640 dots X in 96 DPI mode, and 120 dots
  746.     X in 192 DPI mode.  Other sizes are not supported by the
  747.     printer.
  748.  
  749.  Imagewriter II (Imagewriter compatible)
  750.  --------------
  751.  1. Dot matrix b&w/color printer (text and graphics).
  752.  2. Linefeeds # of vertical dots printed.
  753.  3. Density    XDPI    YDPI    XYDPI    Comments
  754.      1     80     72     5760
  755.      2    120     72     8640
  756.      3    144     72    10368
  757.      4    160     72    11520
  758.      5    120    144    17280    two pass
  759.      6    144    144    20736    two pass
  760.      7    160    144    23040    two pass
  761.  
  762.  Nec_Pinwriter (24-wire Pinwriter compatible (P5/P6/P7/P9/P2200))
  763.  -------------
  764.  1. Dot matrix b&w/color printer (text and graphics).
  765.  2. Drives all NEC 24-wire Pinwriter compatible printers.
  766.  3. Linefeeds # of vertical dots printed.
  767.  4. Density    XDPI    YDPI    XYDPI    Comments
  768.      1     90    180     16200
  769.      2    120    180     21600
  770.      3    180    180     32400
  771.      4    120    360     43200    two pass
  772.      5    180    360     64800    two pass
  773.      6    360    180     64800
  774.      7    360    360    129600    two pass
  775.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  776.     13.6 inches (for wide carriage printers).
  777.  6. As of version 35.17, this driver calculates maximum X dots for
  778.     European A size paper as defined in preferences.h.  The calculation
  779.     is based on millimeters minus 1/2 inch (approx 13mm).  Maximum
  780.     paper width is 13.6 inches, so some European A sizes are too large
  781.     for this printer.
  782.  
  783.  Okidata_92
  784.  ----------
  785.  1. Dot matrix non-color printer (text and graphics).
  786.  2. Always linefeeds 7/72 inch (limitation of printer in graphics mode).
  787.  3. Densities supported are 72x72 dpi.
  788.  
  789.  Okidata_293I
  790.  ------------
  791.  1. Dot matrix b&w/color printer (text and graphics).
  792.  2. Drives 292 or 293 using the IBM interface module.
  793.  3. Linefeeds # of vertical dots printed (-1/2 dot if PaperType = Single) *3
  794.  4. Density    XDPI    YDPI    XYDPI    Comments
  795.      1    120    144    17280
  796.      2    240    144    34560
  797.      3    120    288    34560    two pass
  798.      4    240    288    69120    two pass
  799.      5,6,7    same as 4
  800.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  801.     13.6 inches (for wide carriage printers).
  802.  
  803.  Okimate-20
  804.  ----------
  805.  1. Thermal transfer b&w/color printer (text and graphics).
  806.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  807.  3. Linefeeds an even # of dots printed. (ie. if 3 printed, 4 advanced).
  808.  4. Densities supported are 120x144(1) dpi.
  809.  
  810.  Quadram_QuadJet
  811.  ---------------
  812.  1. Ink jet b&w/color printer (text and graphics).
  813.  2. Linefeeds # of vertical dots printed.
  814.  3. Densities supported are 83x84(1) dpi.
  815.  
  816.  Qume_LetterPro_20
  817.  -----------------
  818.  1. Daisywheel printer (text only).
  819.  
  820.  Seiko_5300
  821.  ----------
  822.  1. Thermal transfer b&w/color printer (graphics only).
  823.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  824.  3. Density    XDPI    YDPI    XYDPI    Comments
  825.      1    152    152    23104    drives CH-5301 printer
  826.      2    203    203    41209    drives CH-5312 printer
  827.      3    240    240    57600    drives CH-5303 printer
  828.      4, 5,6,7    same as 3
  829.      You must select the proper density to drive the specific printer
  830.      that you have.
  831.  4. This driver is not on the V1.3 Workbench or Extras disk.  It is
  832.     available on BIX and directly from Seiko.
  833.  
  834.  Seiko_5300a
  835.  -----------
  836.  1. Thermal transfer b&w/color printer (graphics only).
  837.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  838.  3. Density    XDPI    YDPI    XYDPI    Comments
  839.      1    152    152    23104    drives CH-5301 printer
  840.      2    203    203    41209    drives CH-5312 printer
  841.      3    240    240    57600    drives CH-5303 printer
  842.      4, 5,6,7    same as 3
  843.      You must select the proper density to drive the specific printer
  844.      that you have.
  845.  4. This driver is the same as the Seiko_5300 driver EXCEPT it is
  846.     approximately 2 times faster (during color dumps) and requires LOTS of
  847.     memory (up to 1,564,569 bytes for a full 8 x 10 inch (1927 x 2173 dot)
  848.     color dump).  Typically full-size (color) dumps are 1927 x 1248 dots
  849.     and require 898,569 bytes.  The memory requirements are 1/3 when doing
  850.     a non-color printout.
  851.  5. This driver is not on the V1.3 Workbench or Extras disk.  It is
  852.     available on BIX and directly from Seiko.
  853.  
  854.  Tektronix_4693D
  855.  ---------------
  856.  1. Thermal transfer b&w/color printer (graphics only).
  857.  2. Densities supported are 300x300(1) dpi
  858.  3. Due to the way the printer images a picture none of the printer
  859.     preferences options affect the printout with the following exceptions:
  860.     a)Aspect - Horizontal, Vertical
  861.     b)Shade - B&W, Grey_Scale, Color
  862.     ...as a result of this only full size pictures can be printed.
  863.  4. Keypad menu option 3b COLOR ADJUSTMENT may be set from the keypad.
  864.     For normal prints this option should be set to "do not adjust".
  865.  5. Keypad menu option 3d VIDEO COLOR CORRECTION may be set from the keypad.
  866.     For normal prints this option should be set to "do not adjust".
  867.  6. Keypad menu option 5 BACKGROUND COLOR EXCHANGE may be set from the
  868.     keypad.  For normal prints this option should be set to "print colors
  869.     as received".
  870.  7. Once a picture has been printed additional copies may be printed
  871.     without resending by using the printers keypad.
  872.  8. This driver is not on the V1.3 Workbench or Extras disk.  It is
  873.     available on BIX and directly from Tektronix.
  874.  
  875.  Tektronix_4696
  876.  --------------
  877.  1. Ink jet b&w/color printer (text and graphics).
  878.  2. Always linefeeds 4 dots (limitation of printer).
  879.  3. Densities supported are 121x120(1), 242x120(black)(2) and
  880.     242x120(color)(3).
  881.     Selecting a density of 2 or higher really doesn't give you true 242 dpi
  882.     resolution since the printer only has 121 x dots per inch.
  883.     Instead this mode tells the printer to go into it's double pass mode.
  884.     Here, it outputs a line of dots at 121 dpi; and outputs the line again
  885.     (shifted to the right by 1/242 of an inch).  This produces much more
  886.     vibrate colors and gives the illusion of more resolution.  One drawback
  887.     is that large areas of solid colors (red, green, and blue specifically)
  888.     tend to over-saturate the paper with ink.  Density1 outputs all colors
  889.     in one pass.  Density 2 does a double pass on black.  Density 3 does a
  890.     double pass on all colors.  Density 1 to 3 correspond to the printer's
  891.     graphics printing modes 1 to 3 (respectively).
  892.  4. This driver is not on the V1.3 Workbench or Extras disk.  It is
  893.     available on BIX and directly from Tektronix.
  894.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  895.     9.0 inches (for wide roll paper).
  896.  
  897.  Toshiba_P351C (24-pin Toshiba compatible)
  898.  -------------
  899.  1. Dot matrix b&w/color printer (text and graphics).
  900.  2. Drives all Toshiba_P351C compatible printers.
  901.  3. Linefeeds # of vertical dots printed.
  902.  4. Density    XDPI    YDPI    XYDPI    Comments
  903.      1    180    180    32400
  904.      2    360    180    64800
  905.      3,4,5,6,7    same as 2
  906.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  907.     13.5 inches (for wide carriage printers).
  908.  
  909.  Toshiba_P351SX (24-pin Toshiba compatible)
  910.  --------------
  911.  1. Dot matrix b&w/color printer (text and graphics).
  912.  2. Drives all Toshiba_P351SX (321SL, 321SLC, 341SL) compatible printers.
  913.  3. Linefeeds # of vertical dots printed.
  914.  4. Density    XDPI    YDPI    XYDPI    Comments
  915.      1    180    180     32400
  916.      2    360    180     64800
  917.      3    180    360     64800    two pass
  918.      4    360    360    129600    two pass
  919.      5,6,7    same as 4
  920.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  921.     13.5 inches (for wide carriage printers).
  922.  
  923.  Xerox_4020
  924.  ----------
  925.  1. Ink jet b&w/color printer (text and graphics).
  926.  2. Always linefeeds 4 dots (limitation of printer).
  927.  3. This driver is IDENTICAL to the Diablo_C-150 driver EXCEPT it outputs
  928.     all black dots TWICE.  This is a special feature of this printer and
  929.     produces much more solid, darker black shades.  Please note that some
  930.     printing time overhead results from this feature; if you don't want it
  931.     use the Diablo_C-150 driver.
  932.  4. Densities supported are 121x120(1) and 242x240(2) dpi.
  933.     Selecting a density of 2 or higher really doesn't give you true 240 dpi
  934.     resolution since the Xerox_4020 only has 121 x dots per inch.
  935.     Instead this mode tells the printer to go into it's pseudo 240 dpi mode.
  936.     Here, it outputs a line of dots at 121 dpi; moves the paper up 1/240 of
  937.     an inch and outputs the line again (shifted to the right by 1/240 of an
  938.     inch).  This produces much more vibrate colors and gives the illusion
  939.     of more resolution.  One drawback is that large areas of solid colors
  940.     (red, green, and blue specifically) tend to over-saturate the paper with
  941.     ink.
  942.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  943.     9.0 inches (for wide roll paper).
  944.  
  945.  
  946.  Notes
  947.  -----
  948.  
  949.  *0 - on most printers friction fed paper tends to produce better looking
  950.       (ie. less horizontal banding) graphic dumps than tractor fed paper.
  951.  
  952.  *1 - in this mode the printer cannot print two consecutive dots in a row.
  953.       It is recommended that you only use this density for B&W Shade dumps.
  954.  
  955.  *2 - only when 72 YDPI is selected.  This option is useful if you notice
  956.       tiny white horizontal strips in your printout.
  957.  
  958.  *3 - only when 144 YDPI is selected.  This option is useful if you notice
  959.       tiny white horizontal strips in your printout.
  960.  
  961. printer.device/PRD_PRTCOMMAND                   printer.device/PRD_PRTCOMMAND
  962.  
  963.    NAME
  964.        PRD_PRTCOMMAND -- send a command to the printer
  965.  
  966.    FUNCTION
  967.       This function sends a command to either the parallel or serial
  968.       device.  The printer device maps this command to the control
  969.       code set of the current printer.  The commands supported can
  970.       be found with the printer.device/Write command.  All printers
  971.       may not support all functions.
  972.  
  973.    IO REQUEST IOPrtCmdReq
  974.        io_Message      mn_ReplyPort set
  975.        io_Device       preset by OpenDevice
  976.        io_Unit         preset by OpenDevice
  977.        io_Command      PRD_PRTCOMMAND
  978.        io_PrtCommand   the actual command number
  979.        io_Parm0        parameter for the command
  980.        io_Parm1        parameter for the command
  981.        io_Parm2        parameter for the command
  982.        io_Parm3        parameter for the command
  983.  
  984.    RESULTS
  985.        Errors: if the PRD_PRTCOMMAND succeeded, then io_Error will be zero.
  986.        Otherwise io_Error will be non-zero.  An error of -1 indicates that
  987.        the command is not supported by the current printer driver.  This
  988.        could be used to check if the connected printer supports a particular
  989.        command (italics for example).
  990.  
  991.    SEE ALSO
  992.        printer.device/Write printer.h, parallel.device, Preferences
  993.  
  994. printer.device/PRD_QUERY                             printer.device/PRD_QUERY
  995.  
  996.    NAME
  997.     PRD_QUERY -- query printer port/line status
  998.  
  999.    FUNCTION
  1000.     This command returns the status of the printer port's lines and
  1001.     registers.  Since the printer port uses either the serial or
  1002.     parallel port for i/o, the actual status returned is either the
  1003.     serial or parallel port's status.
  1004.  
  1005.    IO REQUEST
  1006.     io_Message    mn_ReplyPort set if quick I/O is not possible
  1007.     io_Device    preset by the call to OpenDevice
  1008.     io_Command    PRD_QUERY
  1009.     io_Data        ptr to 2 UBYTES where result will be stored.
  1010.  
  1011.    RESULTS
  1012.      io_Data          BIT  ACTIVE  FUNCTION (SERIAL DEVICE)
  1013.  
  1014.              LSB       0    low    reserved
  1015.                        1    low    reserved
  1016.                        2    low    reserved
  1017.                        3    low    Data Set Ready
  1018.                        4    low    Clear To Send
  1019.                        5    low    Carrier Detect
  1020.                        6    low    Ready To Send
  1021.                        7    low    Data Terminal Ready
  1022.              MSB       8    high   read buffer overflow
  1023.                        9    high   break sent (most recent output)
  1024.                       10    high   break received (as latest input)
  1025.                       11    high   transmit x-OFFed
  1026.                       12    high   receive x-OFFed
  1027.                    13-15           reserved
  1028.  
  1029.  
  1030.      io_Data          BIT  ACTIVE  FUNCTION (PARALLEL DEVICE)
  1031.  
  1032.                        0     hi     printer busy (offline)
  1033.                        1     hi     paper out
  1034.                        2     hi     printer selected
  1035.                      (WARNING: the bit 2 line is also connected
  1036.                       to the serial port's ring indicator pin
  1037.                       on the A500 and A2000)
  1038.                      3-7            reserved
  1039.  
  1040.      io_Actual       1-parallel, 2-serial
  1041.  
  1042. printer.device/PRD_RAWWRITE                       printer.device/PRD_RAWWRITE
  1043.  
  1044.    NAME
  1045.     PRD_RAWWRITE -- transparent write command
  1046.  
  1047.    FUNCTION
  1048.     This is a non standard write command that performs no
  1049.     processing on the data passed to it.
  1050.  
  1051.    IO REQUEST
  1052.     io_Message    mn_ReplyPort set if quick I/O is not possible
  1053.     io_Command    PRD_RAWWRITE
  1054.     io_Flags    IOB_QUICK set if quick I/O is possible
  1055.     io_Length    the number of bytes in io_Data
  1056.     io_Data        the raw bytes to write to the printer
  1057.  
  1058. printer.device/PWrite                                   printer.device/PWrite
  1059.  
  1060.    NAME
  1061.     PWrite -- internal write to printer port
  1062.  
  1063.    SYNOPSIS
  1064.     error = (*PrinterData->pd_PWrite)(buffer, length);
  1065.     D0                                  A0      D0
  1066.  
  1067.    FUNCTION
  1068.     PWrite writes 'length' bytes directly to the printer.  This
  1069.     function is generally called by printer drivers to send
  1070.     their buffer(s) to the printer.
  1071.  
  1072.     This function is accessed by referencing off the PrinterData (PD)
  1073.     structure.  Below is a code fragment to show how to do get access
  1074.     to a pointer to the PrinterData (PD) structure.
  1075.  
  1076.     #include <exec/types.h>
  1077.     #include <devices/printer.h>
  1078.     #include <devices/prtbase.h>
  1079.  
  1080.     struct IODRPReq PReq;
  1081.     struct PrinterData *PD;
  1082.     struct PrinterExtendedData *PED;
  1083.  
  1084.     /* open the printer device (any version); if it opened... */
  1085.     if (OpenDevice("printer.device", 0, &PReq, 0) == NULL) {
  1086.  
  1087.         /* get pointer to printer data structure */
  1088.         PD = (struct PrinterData *)PReq.io_Device;
  1089.  
  1090.         /* write something directly to the printer */
  1091.         (*PD->pd_PWrite)("Hello world\n", 12);
  1092.  
  1093.         CloseDevice(&PReq); /* close the printer device */
  1094.     }
  1095.  
  1096.